<?php

namespace app\cps\validate;

use think\Validate;
use app\common\Error;

class Video extends Validate
{
    protected $rule = [
        'video_id' => 'require',
        'video_detail_id' => 'require',
        'id' => 'require',
        'sort' => 'require',
        'pay_amount' => 'require',
        'status' => 'require',
        'watch_reminder' => 'require',
        'sign_reminder' => 'require',
        'link_ids' => 'require',
        'video_pay_setting_id' => 'require',
        'recharge_template_id' => 'require',
    ];

    protected $message = [
        'video_id.require' => Error::VIDEO_ID_NOT_EXIXTS,
        'video_detail_id.require' => Error::VIDEO_DETAIL_ID_NOT_EXIXTS,
        'id.require' => Error::ID_NOT_EXIXTS,
        'sort.require' => Error::SORT_NOT_EXIXTS,
        'pay_amount.require' => Error::PAY_AMOUNT_NOT_EXIXTS,
        'status.require' => Error::STATUS_NOT_EXIXTS,
        'watch_reminder.require' => Error::WATCH_REMINDER_NOT_EXIXTS,
        'sign_reminder.require' => Error::SIGN_REMINDER_NOT_EXIXTS,
        'link_ids.require' => Error::PLEASE_SELECT_UPDATE_LINK,
        'video_pay_setting_id.require' => Error::PLEASE_SELECT_VIDEO_PAY_SETTING,
        'recharge_template_id.require' => Error::PLEASE_SELECT_RECHARGE_TEMPLATE,
    ];

    protected $scene = [
        'detail' => ['video_id'],
        'set_follow_drama' => ['video_detail_id'],
        'config_detail' => ['id'],
        'add_config' => ['video_id', 'sort', 'pay_amount', 'status'],
        'edit_config' => ['id', 'video_id', 'sort', 'pay_amount', 'status'],
        'delete_config' => ['id'],
        'setting' => ['watch_reminder', 'sign_reminder'],
        'batch_setting_pay' => ['link_ids', 'video_pay_setting_id'],
        'batch_setting_template' => ['link_ids', 'recharge_template_id'],
        'batch_update_back' => ['link_ids'],
    ];
}